package com.emily.test.service.impl;

import com.emily.test.mapper.TCompanyResourceMapper;
import com.emily.test.model.TCompanyResource;
import com.emily.test.service.TCompanyResourceService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service("tCompanyResourceServiceAgent")
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT,timeout=36000,rollbackFor=Exception.class)
public class TCompanyResourceServiceImpl implements TCompanyResourceService {
    @Resource
    private TCompanyResourceMapper tCompanyResourceMapper;

    @Override
    public int insertTCompanyResourceInfo(Map<String, Object> map) {
        return tCompanyResourceMapper.insertTCompanyResourceInfo(map);
    }

    @Override
    public int deleteTCompanyResourceByComId(Integer companyId) {
        return tCompanyResourceMapper.deleteTCompanyResourceByComId(companyId);
    }

    @Override
    public List<TCompanyResource> selectTCompanyReSourceIDByComId(Integer companyId) {
        return  tCompanyResourceMapper.selectTCompanyReSourceIDByComId(companyId);
    }

    @Override
    public List<Map<String, Object>> selectTCompanyResourceInfoByCompanyId(Integer companyId) {
        return tCompanyResourceMapper.selectTCompanyResourceInfoByCompanyId(companyId);
    }

    @Override
    public List<Map<String, Object>> selectTCompanyResourceInfoByCompanyIds(List li) {
        return tCompanyResourceMapper.selectTCompanyResourceInfoByCompanyIds(li);
    }

    @Override
    public int insert(TCompanyResource tCompanyResource) {
        return tCompanyResourceMapper.insertSelective(tCompanyResource);
    }

    @Override
    public void delByReId(Integer ReId) {
        tCompanyResourceMapper.delByReId(ReId);
    }

    @Override
    public List<Map<String, Object>> getResourceInfoByCompanyIdList(Integer companyId) {
        return tCompanyResourceMapper.getResourceInfoByCompanyIdList(companyId);
    }
}
